// component/commentPop/commentPop.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    show: {
      type: Boolean,
      value: false
    },
    // //是否情况数据
    // isEmpty:{
    //    type:Boolean,
    //    value:false,
    // }
    isTab: {
      type: Boolean,
      value: false
    }

  },

  /**
   * 组件的初始数据
   */
  data: {
    commentValue: "",
    height: 0,
    keyBoardHeight: 0,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    clickCenterPopupOverlay() {
      this.triggerEvent('popupHide', { show: false });
    },
    //输入框回调
    bindInputAction(e) {
      // console.log("JJLog:输入框回调:" + JSON.stringify(e));
      this.setData({
        commentValue: e.detail.value
      })
    },
    //发送消息
    sendAction() {
      if (!this.data.commentValue) {
        return;
      }
      this.triggerEvent('popupSend', { comment: this.data.commentValue });
      this.setData({
        commentValue: ""
      })
    },
    //键盘监听:
    keyBoardHeightChange(e) {
      console.log("JJLog:键盘变化:" + JSON.stringify(e));
      let height = e.detail.height;
      this.setData({
        keyBoardHeight: height,
      })
      // debounce(this.changePlaViewHeight)
    },
    //改变占位视图高度:
    changePlaViewHeight() {
      this.setData({
        keyBoardHeight: height
      })
    },
  }
})
